<?php /* Smarty version Smarty-3.1.12, created on 2013-04-06 13:45:37
         compiled from "D:\wamp\www\acps_new\templates\protocol\timesheets-client.tpl" */ ?>
<?php /*%%SmartyHeaderCode:8440513bb008a41419-54828765%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '263615f9abbbacb4d946e09b4b68af8f19cb1f3f' => 
    array (
      0 => 'D:\\wamp\\www\\acps_new\\templates\\protocol\\timesheets-client.tpl',
      1 => 1365255934,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '8440513bb008a41419-54828765',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_513bb0090471f5_32807281',
  'variables' => 
  array (
    'data' => 0,
    'i' => 0,
    'month' => 0,
    'year' => 0,
    'filter' => 0,
    'value' => 0,
    'counter' => 0,
    'bgClass' => 0,
    'record' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_513bb0090471f5_32807281')) {function content_513bb0090471f5_32807281($_smarty_tpl) {?><script type="text/javascript">
    
        $(document).ready(function() {
            $("#fulltext").keyup(function(event){
                if(event.keyCode == 13){
                    setFulltext($('#fulltext').val(),'timesheets_fulltext')
                }
            });
        });
    
</script>
<h2 class="pageTitle">Timesheets</h2>
<?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<div class="menu-list">
    Month: 
    <select size="1" onchange="filter('month',this.value,'timesheets_filter')">
        <option value="-1">-</option>
        <?php  $_smarty_tpl->tpl_vars["month"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["month"]->_loop = false;
 $_smarty_tpl->tpl_vars["i"] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['months']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["month"]->key => $_smarty_tpl->tpl_vars["month"]->value){
$_smarty_tpl->tpl_vars["month"]->_loop = true;
 $_smarty_tpl->tpl_vars["i"]->value = $_smarty_tpl->tpl_vars["month"]->key;
?>
            <option value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['month']->value;?>
</option>
        <?php } ?>
    </select>
    Year: 
    <select size="1" onchange="filter('year',this.value,'timesheets_filter')">
        <option value="-1">-</option>
        <?php  $_smarty_tpl->tpl_vars["year"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["year"]->_loop = false;
 $_smarty_tpl->tpl_vars["i"] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['years']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["year"]->key => $_smarty_tpl->tpl_vars["year"]->value){
$_smarty_tpl->tpl_vars["year"]->_loop = true;
 $_smarty_tpl->tpl_vars["i"]->value = $_smarty_tpl->tpl_vars["year"]->key;
?>
            <option value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['year']->value;?>
</option>
        <?php } ?>
    </select>
    Fulltext search: <input id="fulltext" type="text" value="<?php if ($_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?><?php echo $_smarty_tpl->tpl_vars['data']->value['currentFulltext'];?>
<?php }?>" /><input value="Search" type="button" onclick="setFulltext($('#fulltext').val(),'timesheets_fulltext')" />
</div>
<?php if ($_smarty_tpl->tpl_vars['data']->value['currentFilter']||$_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?>
    <div class="menu-list bgDark">
        <b>Current filter:</b> 
        <ul>
            <?php  $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['value']->_loop = false;
 $_smarty_tpl->tpl_vars['filter'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['currentFilter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value){
$_smarty_tpl->tpl_vars['value']->_loop = true;
 $_smarty_tpl->tpl_vars['filter']->value = $_smarty_tpl->tpl_vars['value']->key;
?>
                <li><?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
 = <i><?php echo $_smarty_tpl->tpl_vars['value']->value;?>
</i> [<a href="javascript: cancelFilter('<?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
','timesheets_filter')" class="baseLink">Cancel</a>]</li>
            <?php } ?>
            <?php if ($_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?>
                <li>Fulltext = <i><?php echo $_smarty_tpl->tpl_vars['data']->value['currentFulltext'];?>
</i> [<a href="javascript: cancelFulltext('timesheets_fulltext')" class="baseLink">Cancel</a>]</li>
            <?php }?>
        </ul>
    </div>
<?php }?>
<table class="list">
    <tr>
        <th style="width: 80px" ><a href="javascript: order('date','timesheets_order')"><label for="rdate">Date*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="date"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 120px" ><a href="javascript: order('type','timesheets_order')"><label for="rtype">Type of record*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="type"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 120px" ><a href="javascript: order('tariff','timesheets_order')"><label for="rtariff">Tariff</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="tariff"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 200px" ><a href="javascript: order('description','timesheets_order')"><label for="rdescription">Description*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="description"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 150px" ><a href="javascript: order('user_id','timesheets_order')"><label for="rclient">Added by*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="user_id"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 150px" ><a href="javascript: order('client','timesheets_order')"><label for="rclient">Client*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="client"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 80px" ><a href="javascript: order('amount','timesheets_order')"><label for="ramount">Amount*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="amount"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 80px" ><a href="javascript: order('unit_price','timesheets_order')"><label for="rprice">Unit price*</label> <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="unit_price"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th style="width: 20px;"></th>
    </tr>
    <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);?>
    <?php  $_smarty_tpl->tpl_vars['record'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['record']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['records']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['record']->key => $_smarty_tpl->tpl_vars['record']->value){
$_smarty_tpl->tpl_vars['record']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['record']->key;
?>
        <?php if ($_smarty_tpl->tpl_vars['counter']->value==1){?>
            <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgDark', null, 0);?>
        <?php }else{ ?>
            <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgLight', null, 0);?>
        <?php }?>
        <tr class="<?php echo $_smarty_tpl->tpl_vars['bgClass']->value;?>
">
            <?php if ($_smarty_tpl->tpl_vars['counter']->value==1){?>
                <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(2, null, 0);?>
            <?php }else{ ?>
                <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);?>
            <?php }?>
            <td><a class="filterLink" href="javascript: filter('date','<?php echo $_smarty_tpl->tpl_vars['record']->value['date'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['date_formated'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('type','<?php echo $_smarty_tpl->tpl_vars['record']->value['type'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['type_info']['type_of_record'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('tariff','<?php echo $_smarty_tpl->tpl_vars['record']->value['tariff'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['tariff_info']['title'];?>
</a></td>
            <td><?php echo $_smarty_tpl->tpl_vars['record']->value['description'];?>
</td>
            <td><a class="filterLink" href="javascript: filter('user_id','<?php echo $_smarty_tpl->tpl_vars['record']->value['user_id'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['user_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['record']->value['user_info']['surname'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('client','<?php echo $_smarty_tpl->tpl_vars['record']->value['client'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['client_info']['name'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('amount','<?php echo $_smarty_tpl->tpl_vars['record']->value['amount'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['amount'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('unit_price','<?php echo $_smarty_tpl->tpl_vars['record']->value['unit_price'];?>
','timesheets_filter')"><?php echo $_smarty_tpl->tpl_vars['record']->value['unit_price'];?>
</a></td>
            <td>
                <?php if ($_smarty_tpl->tpl_vars['record']->value['taskId']!=0){?>
                    <a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=edit_task&amp;task=<?php echo $_smarty_tpl->tpl_vars['record']->value['taskId'];?>
" title="to task">
                        <img height="10" width="10" src="<?php echo @PATH_TO_IMAGES;?>
arrow.png" title="to task" alt="to task" />
                    </a>
                <?php }?>
            </td>
        </tr>
    <?php } ?>
</table>
<div class="menu-list">
    <span class="pager"><?php echo $_smarty_tpl->tpl_vars['data']->value['pager'];?>
</span>
    Records per page
    <select class="pager" size="1" onchange="changeRecordsPerPage(this.value, 'timesheets_pager')">
        <option <?php if ($_SESSION['timesheets_pager']==20){?>selected="selected"<?php }?> value="20">20</option>
        <option <?php if ($_SESSION['timesheets_pager']==50){?>selected="selected"<?php }?> value="50">50</option>
        <option <?php if ($_SESSION['timesheets_pager']==100){?>selected="selected"<?php }?> value="100">100</option>
        <option <?php if ($_SESSION['timesheets_pager']==200){?>selected="selected"<?php }?> value="200">200</option>
    </select>
    
</div><?php }} ?>